<template>
  <div>公司管理</div>
</template>
<script lang="ts">
import { RouteLocationNormalized } from 'vue-router'
export default {
  name: 'comIninin',
  beforeRouteEnter (to, from, next) {
    // 组件内的守卫钩子,发生在路由信息变化之前
    console.log('不给进')
    console.log(to, next, from)
    next()
    // 用是否执行next方法来判定是否能进去该页面
  },
  beforeRouteLeave (
    to: RouteLocationNormalized,
    from: RouteLocationNormalized,
    next
  ) {
    // 组件内的守卫钩子,发生在路由信息变化之后
    const { path } = to
    if (path !== '/qati') return next()
  }
}
</script>
